//
//  HtHomeworkManufacturing.m
//  HondaPro_2
//
//  Created by ht on 13-6-29.
//  Copyright (c) 2013年 glendale. All rights reserved.
//

#import "HtHomeworkManufacturing.h"
#import "AddServiceViewController.h"
#import "PdfViewController.h"
#import <QuartzCore/QuartzCore.h>
#import "UIViewController+MJPopupViewController.h"
#import "webConfig.h"
#import "webService.h"
#define NUMBERS @".0123456789\n"
#import "AppDelegate.h"

#import "NSData+Encryption.h"

#import "ServiceHomeViewController.h"
#import "MyAFNetWorkManager.h"
#import "AFNetworking.h"

#import "MultipleCustomerViewController.h"
#import "myTableViewCell.h"
@interface HtHomeworkManufacturing ()
{
    BOOL  _beiY;
    int IndexPathRow;
}

@end

@implementation HtHomeworkManufacturing


- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self)
    {
        
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    [self setUI];
}
-(void)setUI{
    UIButton *backButton = [UIButton buttonWithType:UIButtonTypeCustom];
    [backButton setImage:[UIImage imageNamed:@"返回.png"] forState:UIControlStateNormal];
    [backButton setFrame:CGRectMake(50, 30, 45, 60)];
    [backButton addTarget:self action:@selector(back:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:backButton];
    
    UILabel *jiesuan = [[UILabel alloc]initWithFrame:CGRectMake(160, 50, 200, 40)];
    jiesuan.text = @"维修结算";
    jiesuan.backgroundColor = [UIColor clearColor];
    jiesuan.textColor = [UIColor grayColor];
    jiesuan.font = [UIFont systemFontOfSize:28];
    [self.view addSubview:jiesuan];
    
    //结算与打印
    WEAKSELF;
    UIButton *printBtn = [[UIButton alloc]init];
    [printBtn setTitle:@"结算&打印" forState:UIControlStateNormal];
    printBtn.titleLabel.font=HJFont(13);
    [printBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    [printBtn setBackgroundImage:[UIImage imageNamed:@"ht05-1.png"] forState:UIControlStateNormal];
    [printBtn addTarget:self action:@selector(clickPrint) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:printBtn];
    [printBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.size.mas_equalTo(CGSizeMake(100, 32));
        make.right.mas_equalTo(weakSelf.view).inset(100);
        make.centerY.mas_equalTo(jiesuan);
        
    }];
    
    UIImageView *image1 = [[UIImageView alloc]initWithFrame:CGRectMake(40, 100, 950, 11)];
    image1.image = [UIImage imageNamed:@"渐变分割线.png"];
    [self.view addSubview:image1];
    
    [self loadSecondPartPicture];
}
-(void)back:(id)sender
{
    [self.navigationController popViewControllerAnimated:YES];
}
//*****************固定标题
-(void)loadSecondPartPicture
{

    [self setupTitleLableWithText:@"作业单号:" frame:CGRectMake(65, 25, 90, 40) textColor:[UIColor grayColor] backgroundColor:[UIColor clearColor] fontSize:16];
    
    [self setupTitleLableWithText:@"牌  照  号:" frame:CGRectMake(65, 75, 90, 40) textColor:[UIColor grayColor] backgroundColor:[UIColor clearColor] fontSize:16];
    
    [self setupTitleLableWithText:@"车  架  号:" frame:CGRectMake(65, 245-120, 90, 40) textColor:[UIColor grayColor] backgroundColor:[UIColor clearColor] fontSize:16];
    
    [self setupTitleLableWithText:@"车型名称:" frame:CGRectMake(370, 145-120, 90, 40) textColor:[UIColor grayColor] backgroundColor:[UIColor clearColor] fontSize:16];
    
    [self setupTitleLableWithText:@"接待日期:" frame:CGRectMake(370, 195-120, 90, 40) textColor:[UIColor grayColor] backgroundColor:[UIColor clearColor] fontSize:16];
    
    [self setupTitleLableWithText:@"预交车日:" frame:CGRectMake(370, 245-120, 90, 40) textColor:[UIColor grayColor] backgroundColor:[UIColor clearColor] fontSize:16];
    
    [self setupTitleLableWithText:@"送  修  人:" frame:CGRectMake(680, 145-120, 90, 40) textColor:[UIColor grayColor] backgroundColor:[UIColor clearColor] fontSize:16];

    [self setupTitleLableWithText:@"客户名称:" frame:CGRectMake(680, 245-120-50, 90, 40) textColor:[UIColor grayColor] backgroundColor:[UIColor clearColor] fontSize:16];
}
#pragma mark - 公共方法
-(UILabel *)setupTitleLableWithText:(NSString *)text frame:(CGRect)frame textColor:(UIColor *)textColor backgroundColor:(UIColor *)bgColor fontSize:(int)fontSize{
    UILabel *fixed1 = [[UILabel alloc]initWithFrame:frame];
    fixed1.text = text;
    fixed1.backgroundColor = bgColor;
    fixed1.textColor = textColor;
    fixed1.font = [UIFont fontWithName:@"ArialMT" size:fontSize];
    [self.view addSubview:fixed1];
    return fixed1;
}


-(NSMutableDictionary *)readershuDICimform
{
    NSMutableDictionary *dic=[NSMutableDictionary dictionary];
    NSArray *paths=NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
    NSString *path=[paths objectAtIndex:0];
    NSString *str=[path stringByAppendingPathComponent:@"Dic.text"];
    dic=[NSMutableDictionary dictionaryWithContentsOfFile:str];
    //nslog(@"%@",dic);
    return dic;
}
@end
